package nii.game.mobileserio.action_game;

import nii.game.mobileserio.dialog.DialogExit;
import android.app.Activity;
import android.content.Intent;
import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.widget.Button;

public class Gameover extends Activity {
	
	
	//==========================|| onCreate Function ||=============================//
	@Override
	protected void onCreate(android.os.Bundle savedInstanceState) 
	{
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
				WindowManager.LayoutParams.FLAG_FULLSCREEN);
		
		setContentView(R.layout.gameover);
		
		// Chơi lại
		Button button_gameover_choilai = (Button)findViewById(R.id.button_gameover_choilai);
		// Menu chính
		Button button_gameover_mainmenu = (Button)findViewById(R.id.button_gameover_mainmenu);
		// Thoát
		Button button_gameover_thoat = (Button)findViewById(R.id.button_gameover_thoat);
		
		
		//===========================|| Touch Events||===============================//
		
		button_gameover_choilai.setOnClickListener(new View.OnClickListener()  // Chơi lại
		{			
			public void onClick(View arg0) {
				Intent i = new Intent(Gameover.this, MainGameActivity.class);
				Gameover.this.startActivity(i);
				Gameover.this.finish();
			}
		});
		
		button_gameover_mainmenu.setOnClickListener(new View.OnClickListener() // Menu chính
		{
			public void onClick(View arg0) {
				Intent i = new Intent(Gameover.this, MenuActivity.class);
				Gameover.this.startActivity(i);
				Gameover.this.finish();
			}
		});

		button_gameover_thoat.setOnClickListener(new View.OnClickListener()  // Thoát
		{			
			public void onClick(View arg0) {
				DialogExit dialogexit = new DialogExit(Gameover.this,Gameover.this);
				dialogexit.show();
			}
		});
	}
}
